package CardGame;

import CardGame.CardGame;

import java.util.ArrayList;
import java.util.List;

public class text {
    //三个人进行玩扑克游戏，每次每个人轮流接一张牌，接5轮；
    public static void playCardGame(List<Card> cardList) {
        List<Card> hand1 = new ArrayList<>();
        List<Card> hand2 = new ArrayList<>();
        List<Card> hand3 = new ArrayList<>();
        List<List<Card>> hands = new ArrayList<>();
        hands.add(hand1);
        hands.add(hand2);
        hands.add(hand3);
        //三个人进行玩扑克游戏，每次每个人轮流接一张牌，接5轮；
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 3; j++) {
                Card card = cardList.remove(0);
                hands.get(j).add(card);
            }
        }
        System.out.println("第一个人的牌是"+hand1);
        System.out.println("第一个人的牌是"+hand2);
        System.out.println("第一个人的牌是"+hand3);
        System.out.println("剩余的牌是"+cardList);
    }
    public static void main(String[] args){
        CardGame cardGame=new CardGame();
        List<Card> cardList=cardGame.buyCard();
        System.out.println(cardGame.buyCard());
        cardGame.showCard(cardList);
        System.out.println(cardList);
        playCardGame(cardList);
    }

}
